package com.tungse.json;


import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.databind.DeserializationFeature;
import com.fasterxml.jackson.databind.ObjectMapper;

/**
 * @Author : Tungse
 * @Date: 2025/7/10 14:11
 * @Description:
 */
public class JsonTest {
    public static void main(String[] args) throws JsonProcessingException {
        ObjectMapper objectMapper = new ObjectMapper();
        objectMapper.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false);



//        EntityTest entityTest = objectMapper.readValue("{  \"name\": \"豆瓣酱\",  \"spicy\": true,  \"limitedEdition\": \"yes\",  \"extraNotes\": \"只在冬天卖\"}", EntityTest.class);
        EntityTest entityTest = new EntityTest();
        entityTest.setExtraNotes("abc");
        entityTest.setLimitedEdition("def");
        entityTest.add("nihao","zhagsan ");
        System.out.println(objectMapper.writeValueAsString(entityTest));

    }
}
